package com.wxl.common.serialport

class SerialUtil {

    companion object {
        /**
         * 拼接当前雷管数量并转成十六进制
         */
        fun getCurrentDetonatorNum(num: Int): String? {
            var number = Integer.toHexString(num)
            if (number.length == 1) number = "000$number" else if (number.length == 2) number =
                "00$number" else if (number.length == 3) number = "0$number"
            return number
        }

        /**
         * 拼接当前雷管数量并转成十六进制
         */
        fun getCurrentDetonatorNum(num: Long): String? {
            var number = java.lang.Long.toHexString(num)
            if (number.length == 1) number = "000$number" else if (number.length == 2) number =
                "00$number" else if (number.length == 3) number = "0$number"
            return number
        }


    }

}